<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js"> <!--<![endif]-->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title></title>
    <#assign base=request.contextPath />
    <link rel="stylesheet" type="text/css" href="${base}/css/cloud.css"/>
    <link rel="stylesheet" href="${base}/frame/layui/css/layui.css">
    <script type="text/javascript" src="${base}/frame/layui/layui.all.js"></script>
    <script type="text/javascript" src="${base}/frame/layui/layui.js"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Free HTML5 Template by FreeHTML5.co"/>
    <meta name="keywords" content="free html5, free template, free bootstrap, html5, css3, mobile first, responsive"/>
    <!-- Facebook and Twitter integration -->
    <meta property="og:title" content=""/>
    <meta property="og:image" content=""/>
    <meta property="og:url" content=""/>
    <meta property="og:site_name" content=""/>
    <meta property="og:description" content=""/>
    <meta name="twitter:title" content=""/>
    <meta name="twitter:image" content=""/>
    <meta name="twitter:url" content=""/>
    <meta name="twitter:card" content=""/>

    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
    <link rel="shortcut icon" href="favicon.ico">

    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,300' rel='stylesheet' type='text/css'>

    <link rel="stylesheet" href="${base}/backstage/login/css/bootstrap.min.css">
    <link rel="stylesheet" href="${base}/backstage/login/css/animate.css">
    <link rel="stylesheet" href="${base}/backstage/login/css/style.css">


    <!-- Modernizr JS -->
    <script src="${base}/backstage/login/js/modernizr-2.6.2.min.js"></script>
    <!-- FOR IE9 below -->
    <!--[if lt IE 9]>
    <script src="${base}/backstage/login/js/respond.min.js"></script>
    <![endif]-->

</head>
<body class="style-3">
<div class="container">
    <div class="row">
        <div class="col-md-12 text-center">
            <ul class="menu">
            </ul>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4 col-md-push-8">

            <form action="#" class="fh5co-form animate-box" data-animate-effect="fadeInRight"
                  style="padding-bottom: 10px;position: relative;">
                <H4>获取区块链防伪信息</H4>
                <div class="form-group">
                    <label for="username" class="sr-only">Username</label>
                    <input type="text" class="form-control" id="tel1" placeholder="请输入手机号" autocomplete="off">
                </div>
                <div class="form-group">
                    <label for="password" class="sr-only">Password</label>
                    <input type="text" class="form-control" id="tel2" placeholder="请再次输入手机号" autocomplete="off">
                </div>
                <div class="form-group">
                    <label for="password" class="sr-only">Password</label>
                    <input type="text" class="form-control" id="extractionCode" placeholder="请输入提取码(区分大小写)"
                           autocomplete="off">
                </div>
                <div class="form-group">
                    <input type="button" id="login" style="align: center;width: 125px" value="提取"
                           class="btn btn-primary">
                    <input type="button" id="loginFan" style="align: center;width: 125px" value="返回"
                           class="btn btn-primary">
                </div>
            </form>

        </div>
    </div>
    <#--<div class="row" style="padding-top: 60px; clear: both;">-->
    <#--<div class="col-md-12 text-center"><p><small>&copy; All Rights Reserved. More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a></small></p></div>-->
    <#--</div>-->
</div>

<!-- jQuery -->
<script src="${base}/backstage/login/js/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="${base}/backstage/login/js/bootstrap.min.js"></script>
<!-- Placeholder -->
<script src="${base}/backstage/login/js/jquery.placeholder.min.js"></script>
<!-- Waypoints -->
<script src="${base}/backstage/login/js/jquery.waypoints.min.js"></script>
<!-- Main JS -->
<script src="${base}/backstage/login/js/main.js"></script>
<script>
    $('#login').on('click', function () {
        //判断用户输入的是否为空 为空就提示用户名不能为空
        if ($("#tel1").val() == "") {
            layer.msg("手机号不能为空");
            return;
        }
        if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test($("#tel1").val()))) {
            layer.msg("手机号格式不对");
            return;
        }
        if ($("#tel2").val() == "") {
            layer.msg("确认手机号不能为空");
            return;
        }
        if (!(/^1(3|4|5|6|7|8|9)\d{9}$/.test($("#tel2").val()))) {
            layer.msg("确认手机号格式不对");
            return;
        }

        if ($("#tel2").val() != $("#tel1").val()) {
            layer.msg("两次手机号不一致");
            return;
        }
        //判断用户输入的是否为空 为空就提示密码不能为空
        if ($("#extractionCode").val() == "") {
            layer.msg("提取码不能为空");
            return;
        }
        $.ajax({
            type: "POST",
            url: "${base}/user/loginResult",
            data: {"tel": $("#tel2").val(), "extractionCode": $("#extractionCode").val()},
            success: function (data) {
                if (data.msg == "手机号和提取码不匹配") {
                    layer.msg(data.msg);
                } else {
                    window.location.href = "${base}/user/userLoginResult.html?tel=" + $("#tel2").val()
                }
            }
        });
    });

    $('#loginFan').on('click', function () {

        window.location.href = "${base}/user/userLogin.html"

    });
    //键盘事件
    $("body").bind("keydown", function (e) {
        // 兼容FF和IE和Opera
        var theEvent = e || window.event;
        var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
        if (code == 13) {
            //回车执行查询
            $("#login").click();
        }
    });
</script>
</body>
</html>

